<?php
	include_once("./commonality.php");
		session_start();
$pid=$_GET['pid'];
echo $pid;

$type=$_GET['type'];
//echo $pid;
	foreach($_SESSION['cart'] as $key=>$value){
		if($value['pid']==$pid){
			if($type==1){
			$num=$value['num']-1;
			
			}elseif($type==2){
			$num=$value['num']+1;
			
			}else{
				$num=$_GET['number'];
			}
			if($num<1){
				$num=1;
			}
			if($num>100){
				$num=100;
			}
			
			$_SESSION['cart'][$key]['num']=$num;
			
		}
}

header("location:./gouwuche.php");
?>